package model

import "github.com/gogf/gf/v2/util/gmeta"

type OrderIdRes struct {
	Id string `json:"id"  dc:"订单id"    v:"required#订单id必填"`
}

type OrderInfoRes struct {
	SiteId          string  `json:"siteId" dc:"站点的id"`
	EquipmentId     string  `json:"equipmentId"  dc:"设备id"`
	EquipmentProp   int     `json:"equipmentProp"  dc:"设备的端口号"`
	UserId          string  `json:"userId"  dc:"用户id"`
	ChargingMode    int     `json:"chargingMode"  dc:" 充电方式 1 扫码充电 2 nfc刷卡充电"`
	ChargingTime    int64   `json:"chargingTime"  dc:"充电时间 0 为充满自停  1 单位为分钟"`
	EndReason       int     `json:"endReason"  dc:"结束原因 1 充满自停  2 用户拔出 3 设备错误"`
	BillingMode     int     `json:"billingMode"  dc:" 计费模式 1 计时 2 包月"`
	StartTime       string  `json:"startTime"  dc:"订单开始时间"`
	EndTime         string  `json:"endTime"  dc:"订单结束时间"`
	Amount          float64 `json:"amount" dc:"充电费用"`
	EquipmentPropId string  `json:"equipmentPropId" dc:"充电设备的端口id"`
	ChargingPower   int     `json:"chargingPower" dc:"充电功率、单位W/瓦"`
}

type OrderInfoDbRes struct {
	gmeta.Meta `orm:"table:lot_order"`
	*OrderInfoRes
	Id              string                  `json:"id"  dc:"订单id"`
	EquipmentDbInfo *EquipmentDbInfoPortRes `json:"equipmentDbInfo" dc:"" orm:"with:id=equipment_id"`
}

type OrderDetailsDbRes struct {
	gmeta.Meta `orm:"table:lot_order"`
	*OrderInfoRes
	Id              string                  `json:"id"  dc:"订单id"`
	EquipmentDbInfo *EquipmentDbInfoPortRes `json:"equipmentDbInfo" dc:"设备详情" orm:"with:id=equipment_id"`
	SiteInfo        *SiteInfoDbRes          `json:"siteInfo" dc:"站点详情" orm:"with:id=site_id"`
}

// OrderSearchList 搜索订单列表的参数
type OrderSearchList struct {
	ChargingMode int    `json:"chargingMode"  dc:" 充电方式 1 扫码充电 2 nfc刷卡充电" v:"in:1,2#充电方式只能按照枚举参数查询"`
	Status       int    `json:"status"  dc:"订单状态1.未完成 2. 已完成" v:"in:1,2#订单状态只能按照枚举参数查询"`
	UserId       string `json:"userId"  dc:"用户id"`
	EndReason    int    `json:"endReason"  dc:"结束原因 1 计量完成/充满自停  2 功率过低/充满 3 功率过高 4.零功率（未插充电器充电或保 险丝断）5. 充电器被拔出（功率正常时突然为 0W 判被拔出）" v:"in:1,2,3,4,5#结束原因只能按照枚举参数查询"`
	*Paging
}

type OrderListRes struct {
	List []*OrderInfoDbRes `json:"list"  dc:"订单列表"`
	*PutPage
}
